public class Test7 {
	public static void main(String[] args) {
		int[] A = new int[] { 10, 5 };
		System.out.println(getDis(A, A.length));
	}

	public static int getDis(int[] A, int n) {
		int max = Integer.MIN_VALUE;
		for (int i = 0; i < A.length; i++) {
			for (int j = i; j < A.length; j++) {
				int num = A[j] - A[i];
				if (num > max) {
					max = num;
				}
			}
		}
		return max;
	}
}
